<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button id="btn1">click</button>
    <button id="btn2">dblclick</button>
    <button id="btn3">contextmenu</button>
    <button id="btn4">mousedown/mouseup</button>
    <button id="btn5">mousemove</button>
    <script>
      document.getElementById("btn1").onclick = () => console.log("click");
      document.getElementById("btn2").ondblclick = () =>
        console.log("dblclick");
      document.getElementById("btn3").oncontextmenu = (e) => {
        e.preventDefault();
        console.log("oncontextmenu");
      };

      document.getElementById("btn4").onmousedown = () =>
        console.log("onmousedown");
      document.getElementById("btn4").onmouseup = () =>
        console.log("onmouseup");
      document.getElementById("btn4").onclick = () => console.log("onclick");

      document.getElementById("btn5").onmousemove = () =>
        console.log("onmousemove");
    </script>
  </body>
</html>
